IF exists (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[SelectCocina]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
	DROP PROCEDURE [dbo].[SelectCocina]
GO

CREATE PROCEDURE [dbo].[SelectCocina]
(
	@cocinaID int
)
AS
BEGIN
	SET NOCOUNT ON

	SELECT
	C.[cocinaID],
	C.[fecha],
	C.[personalID],
	C.[loteID],
	C.[almacenID],
	C.[cantidad],
	C.[estado],
	L.insumoID
	FROM [Cocina] AS C
	INNER JOIN Lotes AS L ON C.loteID = L.loteID
	WHERE C.[cocinaID] = @cocinaID

	SET NOCOUNT OFF
END

GO
